<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>快算一下，你就知道</title>
	<style type="text/css">
		.head{  color:#fff;position:absolute;right:0;top:0;margin:19px 0 5px;padding:0 96px 0 0;}
        .mav{float: left;color: #333;font-weight: 700;line-height: 24px;margin-left: 20px;font-size: 13px;text-decoration:underline;}
		.head a:hover{color:#00c}
		.centers{text-align: center;}
		.gen{position: absolute;right: 10px;width: 60px;height: 23px;float: left;color: #fff;background: #3385ff;line-height: 24px;font-size: 13px;text-align: center;border-bottom: 1px solid #38f;margin-left: 19px;text-decoration: none}
		.imgs{margin-top: 30px}
		.sone{border: 1px solid #b6b6b6;background: #fff;display: inline-block;vertical-align:top;width: 539px;height:34px;border-color: #b8b8b8 #ccc #ccc #b8b8b8;overflow: hidden;}
		span{margin: 0;padding: 0}
		input{border: 0;padding: 0;}
		.sn{height: 16px;width: 18px;}
		.sou{width: 526px;height: 22px;font: 16px/18px arial;line-height: 18px;margin: 6px 0 0 7px;padding: 0;outline: 0;}
		.btn{width: 100px; height: 36px; color: #fff; font-size: 15px; letter-spacing: 1px; background: #3385ff;} 
		.tail{text-align: center;}
		.one{height: 191.5px;}
		
		#lh a{margin-right:12px;}
		i{width: 14px;height: 17px;display: inline-block;}
	</style>
	<meta http-equiv=Content-Type content="text/html;charset=utf-8">
<meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
<meta content=always name=referrer>
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
	function calc() {
		var calcvalue = $("#calcvalue").val();
		var calcResult = "<h2><p>";
		if (calcvalue && !isNaN(parseFloat(calcvalue))) {
			var a = parseFloat(calcvalue);
			var b = a * 100;
			calcResult += "-------------------";
			calcResult += "<br/>";
			calcResult += "第一次买入价：" + a.toFixed(2);
			calcResult += "<br/>";
			calcResult += "第一次买入总金额：" + b.toFixed(2);
			calcResult += "<br/>";
			calcResult += "第一次买入均价：" + a.toFixed(2);
			calcResult += "<br/>";
			calcResult += "-------------------";
			calcResult += "<br/>";
			calcResult += "第二次买入价：" + (a * 0.88).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第二次买入总金额：" + (b * (1 + 0.88)).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第二次买入均价："
					+ (b * (1 + 0.88) / (100 + 100)).toFixed(2);
			calcResult += "<br/>";
			calcResult += "-------------------";
			calcResult += "<br/>";
			calcResult += "第三次买入价：" + (a * 0.76).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第三次买入总金额：" + (b * (1 + 0.88 + 0.76 * 2)).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第三次买入均价："
					+ (b * (1 + 0.88 + 0.76 * 2) / (100 + 100 + 200))
							.toFixed(2);
			calcResult += "<br/>";
			calcResult += "-------------------";
			calcResult += "<br/>";
			calcResult += "第四次买入价：" + (a * 0.64).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第四次买入总金额："
					+ (b * (1 + 0.88 + 0.76 * 2 + 0.64 * 4)).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第四次买入均价："
					+ (b * (1 + 0.88 + 0.76 * 2 + 0.64 * 4) / (100 + 100 + 200 + 400))
							.toFixed(2);
			calcResult += "<br/>";
			calcResult += "-------------------";
			calcResult += "<br/>";
			calcResult += "第五次买入价：" + (a * 0.52).toFixed(2);
			calcResult += "<br/>";
			calcResult += "第五次买入总金额："
					+ (b * (1 + 0.88 + 0.76 * 2 + 0.64 * 4 + 0.52 * 8))
							.toFixed(2);
			calcResult += "<br/>";
			calcResult += "第五次买入均价："
					+ (b * (1 + 0.88 + 0.76 * 2 + 0.64 * 4 + 0.52 * 8) / (100 + 100 + 200 + 400 + 800))
							.toFixed(2);
			calcResult += "<br/>";
		}
		calcResult += "</p></h2>";
		$("#calcResult").empty().html(calcResult);
	}
</script>

</head>
<body>
<div class="baidu">

 
	<div class="centers">
		<div class="imgs" style="height:129px">
			
		</div>
		<span class="sone">
			<input type="text" id="calcvalue" class="sou" maxlength="255">
		</span>
		<span>
			<input class="btn" type="submit" value="快算一下" onclick="calc()">
		</span>
	</div>
 

<div id="calcResult" style="text-align:left;margin-left:600px;"></div>
</div>

</body>
</html>
